home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 1 (Norsk) / backpacker.iso / pc / data / misc / go_all.dxr / 00041_Preferences Handlers.ls < prev    next >
Encoding:
Text File  |  1995-02-28  |  1.3 KB  |  47 lines

  1. on BP_Preferences
  2.   global gPref_path
  3.   if the machineType = 256 then
  4.     set x_lib to "BPXLIB.DLL"
  5.     set pref_fileName to "BACKPACK.INI"
  6.   else
  7.     set x_lib to "BPXLIB.MAC"
  8.     set pref_fileName to "BackPacker preferences"
  9.   end if
  10.   openXLib(the pathName & x_lib)
  11.   set misc to MISC_X(mnew)
  12.   if the machineType = 256 then
  13.     set gPref_path to misc(mWindowsDirectory) & pref_fileName
  14.   else
  15.     if the machineType <> 256 then
  16.       set gPref_path to misc(mPrefsFolder) & pref_fileName
  17.     end if
  18.   end if
  19.   if not misc(mFileExists, gPref_path) then
  20.     Write_Preferences("New")
  21.   end if
  22.   misc(mdispose)
  23.   closeXLib(the pathName & x_lib)
  24. end
  25.  
  26. on Write_Preferences mode
  27.   global J, PNM, gPref_path, MAXPSNDS
  28.   if the machineType = 256 then
  29.     openXLib(the pathName & "FILEIO.DLL")
  30.   end if
  31.   set W to EMPTY
  32.   if mode = "New" then
  33.     set W to W & "BackPacker preferences version 1.0" & RETURN
  34.     set P to RETURN & "[[],[],[]]" & RETURN
  35.     set W to W & ".high scores" & RETURN & ".max aukt" & P & ".max towns" & P
  36.     set W to W & ".max solve" & P & ".min days" & P
  37.     set W to W & ".max days" & P & ".max assign" & P
  38.     set fil to FileIO(mnew, "write", gPref_path)
  39.     fil(mWriteString, W)
  40.     fil(mSetFinderInfo, "TEXT", "BAPA")
  41.     fil(mdispose)
  42.   end if
  43.   if the machineType = 256 then
  44.     closeXLib(the pathName & "FILEIO.DLL")
  45.   end if
  46. end
  47.